home *** CD-ROM | disk | FTP | other *** search
- /* tanh.c from page 248*/
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #define R_TO_D 57.29578 /*radians to degrees */
- main(int argc, char **argv)
- {
- double result;
- if(argc < 2)
- {
- printf("usage: %s <value>\n", argv[0]);
-
- }
- else
- {
- result = tanh(atof(argv[1]));
- if(errno != ERANGE)
- {
- printf("Hyperbolic tangent of %s = %f\n",
- argv[1], result);
- }
- }
- }